package com.bihu.bihudemo.mq;

import com.bihu.bihudemo.config.MqConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RabbitListener(queues = MqConfig.SMSQUEUE)
public class SmsMessageHandler {

    @RabbitHandler
    public void handlerEvent(PostMessage message){
        log.info(message.toString());
        System.out.println(message.toString());
    }
}
